
import {
    judgeOs,
    arrayMove,
    getCurrAbsPath,
    rltToAbs,
    arrayEqual,
    arrayDiff,
    OlFunction,
    inheritClass,
    Delegate,
    encodeHTML,
    decodeHTML,
    templateStringRender,
    strToVar,
    Hashcaller,
    HashListener,
    hashcaller,
    requestAPI,
    download
} from "../js/basics/Basics.js";
import {
    stopPropagation,
    stopEvent,
    stopPE,
    nodeListToArray,
    KeyNotbook,
    addKeyEvent,
    removeKeyEvent,
    addResizeEvent,
    linkClick,
    setupLinkClick
} from "../js/basics/dom_tool.js";
import {
    getBezierMatrix,
    get_BezierCurvePoint__DeCasteljau,
    matrixMULT,
    calcPascalsTriangle,
    getBezierCoefficient,
    get_BezierDerivativesPoints,
    createCutBezierMatrixQ,
    cutBezierByMatrix,
    binaryLinearEquation,
    approximately,
    derivative,
    rootsOfCubic,
    coefficientToPoints,
    Stepper,
    deg
} from "../js/basics/math_ex.js";

import{
    DEF_VirtualElementList,
    DEF_VirtualElement,
    DEF_CSSVE,
    DEF_CSSVEItem,
    DataLink,
    AttrKeyStrCtrl,
    AttrKeyStrCtrl__Ex,
    AttrKeyStrCtrlList,
    CtrlLib,
    ExCtrl
} from "../js/ControlLib/CtrlLib.js"

import {
    cueObjToMediaObj,
    DEF_MediaObjMarkList,
    DEF_MediaObjMark,
    DEF_MediaObj,
    DEF_CUEOBJTrack,
    cueTimeToSecond,
    loadCue,
} from "../js/basics/cue_media_obj.js";
/**
 * 获取控件
 * @param {function} exCtrl_CallBack xCtrl_CallBack(Object) 控件生成完成后的回调, 会返回控件的集合作为实参
 */
function getExCtrl(exCtrl_CallBack){
    getExCtrl.IndexNav;
    getExCtrl.AudioControl;
    if(!getExCtrl.i){
        var cssTag=document.createElement("link");
        cssTag.setAttribute("rel","stylesheet");
        cssTag.setAttribute("href",rltToAbs("./EXCtrl.css",getExCtrl.url));
        document.head.appendChild(cssTag);
        ++getExCtrl.i;
        var EXCtrl_BluePrintXml_request=new XMLHttpRequest();
        EXCtrl_BluePrintXml_request.open("get",rltToAbs("./EXCtrl.xml",getExCtrl.url));

        EXCtrl_BluePrintXml_request.onload=function(e){
            var BluePrintXmlList=this.response.split("<ctrl_tab/>");
            /**
             * 左侧的索引栏 
             */
            class IndexNav extends ExCtrl{
                callback(){
                                    }
            }
            IndexNav.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[0]);
            getExCtrl.Class.IndexNav=IndexNav;

            /**
             * 音乐播放控制器;
             */
            class AudioControl extends ExCtrl{
                initialize(){
                    this.playType=0;
                    this.indexMap=[];
                    this.mapIndex=0;
                    this.playingIndex=-1;
                    this.duration=0;
                    this.paused=true;
                    if(!this.data.mediaList){
                        this.data.mediaList=[];
                    }
                    this.op = 0;
                }
                callback(){
                    if(this.data.mediaList&&this.data.mediaList.length){
                        this.setPlayingIndex(0);
                        this.data.mediaList=this.data.mediaList;
                        this.reIndexMap();
                    }
                    this.setMapIndex(0);
                }
                reRender_Callback(){
                    if(this.playingIndex>=0)
                        this.elements["mediaItem-EX_for-mediaList-C"+(this.playingIndex+1)].classList.add("playing");
                }
                /**
                 * 读取媒体后 渲染轨道长度
                 * @param {Number} _index 当前播放的媒体的 index
                 */
                renderDuration(_index){
                    var audio=this.elements.audioTag,
                        index=_index===undefined?this.playingIndex:_index;
                    var mediaItem=this.data.mediaList[index];
                    if(this.playingIndex>=0){
                        this.duration=mediaItem.getDuration(audio);
                        this.op=mediaItem.op;
                    }
                    else{
                        this.duration=this.elements.audioTag;
                        this.op=0;
                    }
                    audio.currentTime=this.op;
                    if(!this.paused){
                        audio.play();
                    }
                    this.renderString();
                }
                /**
                 * 改变播放顺序的方式
                 * @param {Number} _type 0: 顺序; 1: 逆序; 2: 乱序;
                 */
                setPlayType(_type){
                    this.playType=_type%this.playTypes.length;
                    this.elements.playType.setAttribute("title",this.playTypes[this.playType]);
                    this.renderString();
                    this.reIndexMap();
                    return this.indexMap;
                }
                /**
                 * 新增一个媒体
                 * @param {String} _src     媒体对象
                 * @param {Number} _step    步进 用于切换当前播放的内容
                 * @returns {Number} 返回插入的目的地的下标
                 */
                addItem(media,_step){
                    var tgtIndex=(this.indexMap[this.mapIndex]===undefined?-1:this.indexMap[this.mapIndex])+1;
                    this.data.mediaList.splice(tgtIndex,0,media);
                    this.reIndexMap();
                    this.indexMap.splice(this.mapIndex+1,0,tgtIndex);
                    if(_step)this.setMapIndex(this.indexMapStep(_step));
                    this.setPlayType(this.playType);
                    if(this.playingIndex===-1){
                        this.setPlayingIndex(tgtIndex);
                        this.renderDuration()
                    }
                    this.reRender();
                    return tgtIndex;
                }
                /**
                 * 剔除一个列表项
                 * @param {Number} _index 列表项的下标
                 */
                removeItem(_index){
                    this.data.mediaList.splice(_index,1);
                    this.indexMap.splice(this.indexMap.indexOf(_index),1);
                    this.reRender();
                    this.setPlayType(this.playType);
                }
                /**
                 * 刷新 indexMap
                 * @param {Number} type 0:正向; 1逆向 2乱序
                 */
                reIndexMap(type){
                    var type=type||this.playTypes[this.playType];
                    if(this.data.mediaList.length!==this.indexMap.length){
                        this.indexMap=new Array(this.data.mediaList.length);
                    }
                    switch(type){
                        // 正向
                        case this.playTypes[0]:
                            for(var i=this.data.mediaList.length-1;i>=0;--i){
                                this.indexMap[i]=i;
                            }
                        break;
                        // 逆向
                        case this.playTypes[1]:
                            for(var i=this.data.mediaList.length-1,j=0;i>=0;--i,++j){
                                this.indexMap[i]=j;
                            }
                        break;
                        // 乱序
                        case this.playTypes[2]:
                            if(this.indexMap[1]===undefined);
                            for(var i=this.data.mediaList.length-1;i>=0;--i){
                                this.indexMap[i]=i;
                            }
                            
                            for(var i=this.data.mediaList.length-1;i>=0;--i){
                                var ti=parseInt(Math.random()*this.data.mediaList.length),temp=this.indexMap[0];
                                this.indexMap[0]=this.indexMap[ti];
                                this.indexMap[ti]=temp;
                            }
                            break;
                        }
                        this.mapIndex=this.indexMap.indexOf(this.playingIndex);
                }
                /**
                 * 设置当前的播放媒体的地址, 不影响 mediaList
                 * @param {String} _src 媒体的地址
                 */
                setTempPlaySrc(_src){
                    this.elements["audioTag"].innerHTML="<source src=\""+_src+"\"/>";
                    this.elements["audioTag"].load();
                    this.playingIndex=-2;
                }
                /**
                 * 步进 mapIndex 获取 indexMap 的值
                 * @param {Number} _step 前进 步数
                 */
                indexMapStep(_step){
                    var l=this.indexMap.length,
                    newindex=this.mapIndex+_step;
                    if(newindex<0)newindex=l-1;
                    else if(newindex>=l)newindex=0;
                    return newindex;
                }
                /**
                 * 播放上一个
                 */
                last(){
                    this.setMapIndex(this.indexMapStep(-1));
                }
                /**
                 * 播放下一个
                 */
                next(){
                    this.setMapIndex(this.indexMapStep(1));
                }
                /**
                 * 控件 切换当前播放列表的下标并渲染
                 * @param {Number} _index 
                 */
                setMapIndex(_index){
                    if(this.data.mediaList.length<=0)return;
                    this.mapIndex=_index;
                    this.setPlayingIndex(this.indexMap[_index]);
                }
                /**
                 * 渲染当前播放的index
                 */
                renderPlayingIndex(lowIndex){
                    var lowIndex=lowIndex+1;
                    if(this.elements["mediaItem-EX_for-mediaList-C"+lowIndex]){
                        this.elements["mediaItem-EX_for-mediaList-C"+lowIndex].className="audioControl-mediaItem";
                    }
                    if(this.elements["mediaItem-EX_for-mediaList-C"+(this.playingIndex+1)]){
                        this.elements["mediaItem-EX_for-mediaList-C"+(this.playingIndex+1)].className="audioControl-mediaItem playing";
                    }
                }
                /** 
                 * 跳转到一个播放列表项
                 * @param {Number} _index 列表项的下标
                 */
                setPlayingIndex(_index){
                    if(this.data.mediaList.length<=0) return;
                    if(this.data.mediaList.length<=_index) return;
                    // this.elements["audioTag"].src=this.data.mediaList[_index].url;
                    // this.elements["audioTag"].src="";
                    var tempHTML=[],that=this;
                    if((!this.data.mediaList[this.playingIndex])||(this.data.mediaList[_index].urlList!==this.data.mediaList[this.playingIndex].urlList)){
                        for(var i=this.data.mediaList[_index].urlList.length-1;i>=0;--i){
                            tempHTML.push("<source src=\""+this.data.mediaList[_index].urlList[i]+"\"/>")
                        }
                        this.elements["audioTag"].innerHTML=tempHTML.join("");
                        this.elements["audioTag"].load();
                    }else{
                        this.elements.audioTag.currentTime=this.data.mediaList[_index].op;
                        this.renderDuration(_index);
                    }
                    this.mapIndex=this.indexMap.indexOf(_index);
                    var lowIndex=this.playingIndex;
                    this.playingIndex=parseInt(_index);
                    this.renderPlayingIndex(lowIndex);
                    this.data.mediaList[this.playingIndex].mark.reCount();

                }
                /**
                 * 切换播放暂停
                 */
                playPause(){
                    var a=this.elements.audioTag,
                        b=this.elements.playPause;
                    this.paused=!this.paused;
                    if(!this.paused){
                        a.play();
                    }
                    else{
                        a.pause();
                    }
                    this.renderString();
                }
                /**
                 * 打开/关闭 列表
                 */
                callList(){
                                        var that=this;
                    this.data.mediaListBoxVis=!this.data.mediaListBoxVis;
                    var qCloseCallList=function (e){
                        var tgt=e.target;
                        var flag=true;
                        while(tgt.tagName!=="HTML"){
                            if(tgt===that.elements.root){
                                flag=false;
                                break;
                            }
                            tgt=tgt.parentElement;
                        }
                        if(flag){
                            that.data.mediaListBoxVis=!that.data.mediaListBoxVis;
                            that.renderString();
                            this.removeEventListener("mousedown",qCloseCallList);
                        }
                    }
                    document.addEventListener("mousedown",qCloseCallList);
                    this.renderString();
                }
                
                /**
                 * 渲染当前位置
                 */
                currentTimeRender(){
                    var progress=parseInt(this.elements["audioTag"].currentTime/this.duration*2);
                    progress*=0.5;
                    if(this.playProgress!==progress){
                        this.playBarBtn.style.left=progress+"%";
                        this.playBarLow.style.width=progress+"%";
                        this.playProgress=progress;
                    }
                }
                /**
                 * 加载 cue 文件
                 * @param {String} url
                 */
                loadCue(url){
                    var eee,dd, d=new XMLHttpRequest();
                    var that=this;
                    d.open("get",url);
                    d.send();
                    d.onload=function(){
                        eee=loadCue(d.responseText);
                                                dd=cueObjToMediaObj(eee,url);
                        that.data.mediaList=that.data.mediaList.concat(dd);
                        that.reRender();
                        that.reIndexMap(that.playTypes[that.playType]);
                    }
                }

                volumeHand(e,tgt){
                    if(e.buttons){
                        var val=(Math.ceil(100-(e.layerY/tgt.offsetHeight)*100)*0.01);
                        if(val>1)       val=1;
                        else if(val<0)  val=0;
                        this.elements.audioTag.volume=val;
                    }
                }
                /**
                 * @param {Number} val volume 的值, 取值范围 0~1
                 */
                changVolume(_val){
                    var audio=this.elements.audioTag,val=_val;
                    if(val>1)       val=1;
                    else if(val<0)  val=0;
                    if(val!==audio.volume)audio.volume=val;
                    
                    if(audio.muted||audio.volume<=0){
                        this.elements.root.classList.add("ismuted");
                        this.elements.volumeBarBtn.style.top=(94-val*94)+"%";
                        this.elements.volumeBarPower.style.height="0";
                    }
                    else{
                        this.elements["root"].classList.remove("ismuted");
                        this.elements.volumeBarPower.style.height=(audio.volume*100)+"%";
                        this.elements.volumeBarBtn.style.top=(94-val*94)+"%";
                    }
                }
                wheelHand(e){
                    if(e.deltaY>0){
                        this.changVolume(this.elements.audioTag.volume-0.05);
                    }
                    else if(e.deltaY<0){
                        this.changVolume(this.elements.audioTag.volume+0.05);
                    }
                }
                /**
                 * 进度条上的控制
                 */
                currentTimeHand(e,tgt){
                    var tgtTimeP=(e.layerX-6)/(tgt.offsetWidth-12),tgtTime;
                    if(tgtTimeP>1)tgtTimeP=1;
                    else if(tgtTimeP<0)tgtTimeP=0;
                    tgtTime=this.duration*(tgtTimeP);
                                        this.elements.targetTimeMM.innerHTML=parseInt(tgtTime/60);
                    this.elements.targetTimeSS.innerHTML=parseInt(tgtTime%60);
                    this.elements.ctrlTimeBox.style.left=(tgtTimeP*94+3)+"%";
                    if(e.type==="mouseup"){
                        this.elements.audioTag.currentTime=this.op+tgtTime;
                    }
                }
                /** 渲染 */
                renderCurrentTime(){
                    var tgtTime=this.getCurrentTime();
                    this.elements.currentTimeMM.innerHTML=parseInt(tgtTime/60);
                    this.elements.currentTimeSS.innerHTML=parseInt(tgtTime%60);
                    var tp=tgtTime/this.duration*100
                    
                    if(tp>=100){
                        this.next();
                        // this.elements.audioTag.pause();
                    }else{
                        this.elements.playBarBtn.style.left=tp+"%";
                        this.elements.playBarLow.style.width=tp+"%";
                        this.data.mediaList[this.playingIndex].mark.touchMarkByTime(this,tgtTime,3);
                    }
                }
                /**
                 * 获取当前播放进度
                 */
                getCurrentTime(){
                    return this.elements.audioTag.currentTime-this.op;
                }
                /**
                 * 修改播放进度
                 */
                setCurrentTime(val){
                    this.elements.audioTag.currentTime=val+this.op;
                }
            }
            AudioControl.prototype.playTypes=[
                "order",
                "reverse",
                "out-of-order"
            ];
            AudioControl.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[1]);
            getExCtrl.Class.AudioControl=AudioControl;

            /**
             * 图片轮播?
             */
            class ImgList extends ExCtrl{
                constructor(data){
                    super(data);
                    this.index=0;
                }
                /**
                 * 步进 index 
                 * @param {Number} _step 步长
                 * @returns {Number} 返回新的 index
                 */
                indexStep(_step){
                    var tgtIndex=_step+this.index;
                    return this.setIndex(tgtIndex);
                }
                /**
                 * 更改当前 index
                 * @param {Number} _index
                 */
                setIndex(_index){
                    var index=_index,
                    maxI=this.data.list.length;
                    console.log('index :>> ', index);
                        
                    if(index>=maxI){
                        do{
                            index=index-maxI;
                        }while(index>=maxI)
                    }else if(index<0){
                        do{
                            index=maxI+index;
                        }while(index<0)
                    }
                    this.index=index;
                    this.renderString();
                    return this.index;
                }
            }
            ImgList.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[2]);
            getExCtrl.Class.ImgList=ImgList;

            /**
             * 内容容器
             */
            class ContentListBox extends ExCtrl{
                constructor(data,typeset){
                    super(data);
                    this.index=0;
                    this.pageIndex=0;
                    this.typeset={
                        img:[0,0],
                        imgtext:[0,0],
                        text:[0,0]
                    }
                    this.typesetSize={
                        img:[0,0],
                        imgtext:[0,0],
                        text:[0,0]
                    }
                    // 0垂直; 1水平
                    this.boxTypeset=new Stepper(1,0,0);
                    if(this.data.boxTypeset){
                        this.boxTypeset.set(parseInt(this.data.boxTypeset));
                    }
                    this.setTypeset(typeset||this.data.typeset);
                }
                initialize(pnode,typeset){
                    if(typeset)this.setTypeset(typeset);
                    this.l=this.pageIndex*this.getPageSize();
                }
                reRender_Callback(){
                    this.l=this.pageIndex*this.getPageSize();
                }
                /**
                 * 获取每页有多少个项
                 * @returns {Number}
                 */
                getPageSize(){
                    return  this.typeset.img[0]*
                            this.typeset.img[1]+
                            this.typeset.imgtext[0]*
                            this.typeset.imgtext[1]+
                            this.typeset.text[0]*
                            this.typeset.text[1];
                }
                /**
                 * 获取最大页数
                 * @returns {Number}
                 */
                getPageLength(){
                    return parseInt(this.data.list.length/this.getPageSize());
                }
                /**
                 * 跳转到指定页
                 * @param {Number} newIndex 新的页下标
                 */
                tabPage(newIndex){
                    var psize=this.getPageSize(),
                        pl=this.getPageLength();
                    this.pageIndex=newIndex<0?0:newIndex>pl?pl:newIndex;
                    this.l=this.pageIndex*psize;
                    console.log(pl,this.l);
                    this.reRender();
                }
                /**
                 * 设置 typeset
                 */
                setTypeset(typeset){
                    // 设置 typeset
                    if(typeset){
                        this.typeset={
                            img:[0,0],
                            imgtext:[0,0],
                            text:[0,0]
                        }
                        Object.assign(this.typeset,typeset);
                    }
                    else{
                        this.typeset={
                            img:[2,4],
                            imgtext:[0,0],
                            text:[0,0]
                        }
                    }
                    // 刷新 typesetSize
                    var imgSize=[1,4],imgtextSize=[3,4],textSize=[2,1];
                    var j=this.boxTypeset.i,
                        mj;
                    mj=this.typeset.img[j]*imgSize[j]+this.typeset.imgtext[j]*imgtextSize[j]+this.typeset.text[j]*textSize[j];
                    
                    this.typesetSize.img[j]=imgSize[j]/mj*100*this.typeset.img[j];
                    this.typesetSize.imgtext[j]=imgtextSize[j]/mj*100*this.typeset.imgtext[j];
                    this.typesetSize.text[j]=textSize[j]/mj*100*this.typeset.text[j];
                    j=this.boxTypeset.next(1);
                    for(var i in this.typeset){
                        this.typesetSize[i][j]=100;
                    }
                    this.boxTypeset.next(-1)
                    this.renderStyle();
                }
            }
            
            ContentListBox.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[3]);
            getExCtrl.Class.ContentListBox=ContentListBox;

            class TabPage extends ExCtrl{
                /**
                 * 页码控件 基类
                 * @param {Number} index 当前页
                 * @param {Number} visLength 指定页码显示长度
                 */
                constructor(data,index,visLength){
                    super(data);
                    this.visLength=visLength;
                    this.pageBase;
                    this.absIndex=index||0;
                }
                /**
                 * 呼叫目标执行 
                 * @param {function} fns 目标执行的函数
                 */
                callTGT(fns){}  //虚方法
                /**
                 * 跳转到指定页
                 * @param {Number} _index  目标的页码
                 */
                tabIndex(_index){
                    var index=_index>0?_index:0;
                    this.absIndex=index;
                    this.callTGT(function(){
                        this.tabIndex(index);
                    });
                    this.renderStyle()
                }
                /**
                 * 获取当前显示的页码
                 */
                getClip(){
                    return {op:0,ed:10}
                }
            }
            TabPage.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[4]);
            
            class BrotherTabPage extends TabPage{
                /**
                 * 作为兄弟控件的页码控件
                 * @param {String} tgtCtrlID 需要操作的兄弟控件的 ctrl_id
                 */
                constructor(data,index,visLength,tgtCtrlID){
                    super(data,index,visLength);
                    this.tgtCtrlID=tgtCtrlID;
                }
                callTGT(fns){
                    this.callBrother(this.tgtCtrlID,function(){
                        fns.call(this);
                    });
                }
            }
            class childTabPage extends TabPage{
                /**
                 * 作为子控件的页码控件
                 */
                constructor(data,index,visLength){
                    super(data,index,visLength);
                }
                callTGT(fns){
                    this.callParent(function(){
                        fns.call(this);
                    });
                }
            }
            getExCtrl.Class.BrotherTabPage=BrotherTabPage;
            getExCtrl.Class.childTabPage=childTabPage;

            class ReadingList extends ExCtrl{
                /**
                 * 文章列表
                 * @param {Object} data
                 * @param {Number} index 页码
                 */
                constructor(data,absIndex){
                    super(data,absIndex);
                    /** 请求的 api 的 url*/
                    this.apiUrl="";
                    /** 放数据的 */
                    this.dataList=[data];
                    /** 当前的页码 */
                    this.absIndex=absIndex||0;

                    /** 一次请求多少页数据 */
                    this.responseSize=5;
                    /** 每一页显示多少条 */
                    this.visPageSize=10;
                    
                    /** 当前渲染的数据下标 */
                    this.pageDataP={x:0,y:0};
                    /** 后继是否还有数据可以使用 */
                    this.isEnd=false;
                    this.pageTempData=[];
                }
                /**
                 * 获取新的 pageDataP
                 * @returns {{x:Number,y:Number}} 会返回新的 pageDataP
                 */
                getPageDataP(tgtP = this.absIndex*this.visPageSize){
                    var tgtP = tgtP;
                    var y=0;
                    var i =0;
                    for(;i<this.dataList.length;++i){
                        if((y=tgtP-this.dataList[i].beginIn)>this.dataList[i].list.length){
                            break;
                        }
                    }
                    if(i>=this.dataList.length) return false;
                    return {x:i,y:y};
                }
                callback(){
                    this.renderPage();
                }
                /**
                 * 刷新 pageDataP
                 */
                rePageDataP(){
                    var low= this.pageDataP;
                    if(!(this.pageDataP=this.getPageDataP())){
                        this.pageDataP=low;
                    }
                }
                /**
                 * 根据 pageDataP 生成 新的 渲染用 数据
                 * @param {function} callback 加载数据后运行 callback.call(this);
                 */
                getPageTempData(callback){
                    /** {{url:String,title:String,text:String,cover:String,author:String,date:String,view:String,comment:String,tag:String[]}[]} */
                    var rtn=[];
                    // rtn是数据

                    var tempP=this.pageDataP.x,
                        temp=this.dataList[tempP],
                        tempPP;

                    var i= this.pageDataP.y;
                    for(;rtn.length<=this.visPageSize;++i){
                        rtn.push(temp.list[i]);
                        if(i>=temp.list.length&&temp.isEnd){
                            // 当前这组数据不足以渲染整页,但是还有其他可用的组
                            // 查找有没有旧的已经获取过的可用数据
                            if(tempPP=this.getPageDataP(rtn.length)){
                                // 有已加载过的数据
                                temp=this.dataList[tempPP.x];
                                tempP=tempPP.x;
                                callback.call(this,rtn);
                            }else{
                                // 没有加载过数据, 向 api 发送获取数据的请求, 等待加载完成再唤起
                                var that=this;
                                ExCtrl.getJsonData("get",this.apiUrl,function(data){
                                    that.dataList.push(data);
                                    // 重新唤起
                                    that.getPageTempData(callback);
                                },{
                                    beginIn:this.dataList[tempP].beginIn+i,
                                    maxLength:this.responseSize*this.visPageSize
                                });
                                return;
                            }
                        }
                    }
                    callback.call(this,rtn);
                }
                renderPage(){
                    this.getPageTempData(
                        function(tempData){
                            console.log(tempData);
                            this.pageTempData=tempData;
                            this.reRender();
                        }
                    )
                }
                /**
                 * 跳转到指定页
                 * @param {Number} index 新的 页 下标 
                 */
                tabIndex(absIndex){
                    this.absIndex=absIndex;
                    this.renderPage();
                    console.log(1);
                }
                
            }
            ReadingList.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[5]);
            getExCtrl.Class.ReadingList=ReadingList;
            class rotateImgExhibitionBox extends ExCtrl{   
                constructor(data,absIndex){
                    super(data,absIndex);
                }
            }
            rotateImgExhibitionBox.prototype.bluePrint=DEF_VirtualElementList.xmlToVE(BluePrintXmlList[6]);
            getExCtrl.Class.rotateImgExhibitionBox=rotateImgExhibitionBox;
            
            exCtrl_CallBack(getExCtrl.Class);
        }

        EXCtrl_BluePrintXml_request.send();
    }
    else{
        exCtrl_CallBack(getExCtrl.Class);
    }
}
getExCtrl.i=0;
getExCtrl.url=getCurrAbsPath();
getExCtrl.Class={};

export{
    getExCtrl
}